package com.dashboard.giangday;

import java.sql.ResultSet;
import java.util.ArrayList;
import com.lb.jwitter.connectDatabase.ConnectTTGD;
import com.opensymphony.xwork2.Action;

public class ListNamHoc {
	private ArrayList<String> listNamHoc;
	
	public ArrayList<String> getListNamHoc() {
		return listNamHoc;
	}
	public void setListNamHoc(ArrayList<String> listNamHoc) {
		this.listNamHoc = listNamHoc;
	}
	public String execute() throws Exception
	{
		ConnectTTGD connectionOracle= new ConnectTTGD();
		if(connectionOracle.getConnection()!=null){
			listNamHoc=new ArrayList<String>();
			String query="select distinct namhoc from thoikhoabieu_view where namhoc is not null";
			ResultSet data=connectionOracle.getData(query);
			if(data!=null){
				while(data.next()){
					String namhoc=data.getString("namhoc");
					listNamHoc.add(namhoc);
				}
			}
			
		}
		connectionOracle.closeConnection();
		return Action.SUCCESS;

	}
}
